﻿using System.Windows.Navigation;

namespace YourLastOptionsDialog.ViewModels
{
    /// <summary>
    /// A view model base class that abstracts the navigation features of Silverlight's page model.
    /// </summary>
    public class NavigationViewModelBase : ViewModelBase
    {
        /// <summary>
        /// Raises the NavigatingFrom event.
        /// </summary>
        /// <param name="e">The <see cref="NavigatingCancelEventArgs"/> instance containing the event data.</param>
        protected virtual void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
        }

        /// <summary>
        /// Raises the NavigatedFrom event.
        /// </summary>
        /// <param name="e">The <see cref="NavigationEventArgs"/> instance containing the event data.</param>
        protected virtual void OnNavigatedFrom(NavigationEventArgs e)
        {
        }

        /// <summary>
        /// Raises the NavigatedTo event.
        /// </summary>
        /// <param name="e">The <see cref="NavigationEventArgs"/> instance containing the event data.</param>
        protected virtual void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        /// <summary>
        /// Internal helper method.
        /// </summary>
        /// <param name="e">The <see cref="NavigatingCancelEventArgs"/> instance containing the event data.</param>
        internal void InternalNavigatingFrom(NavigatingCancelEventArgs e)
        {
            OnNavigatingFrom(e);
        }

        /// <summary>
        /// Internal helper method.
        /// </summary>
        /// <param name="e">The <see cref="NavigationEventArgs"/> instance containing the event data.</param>
        internal void InternalNavigatedFrom(NavigationEventArgs e)
        {
            OnNavigatedFrom(e);
        }

        /// <summary>
        /// Internal helper method.
        /// </summary>
        /// <param name="e">The <see cref="NavigationEventArgs"/> instance containing the event data.</param>
        internal void InternalNavigatedTo(NavigationEventArgs e)
        {
            OnNavigatedTo(e);
        }
    }
}
